﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true" CodeBehind="TeacherInfo.aspx.cs" Inherits="ESCHOOL.admin.WebForm4" Title="Teacher Info" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style3
        {
            width: 100%;
        }
        .style4
        {
            height: 26px;
        }
        .style5
        {
            height: 23px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>
        <br />
    </p>
    <table class="style3">
        <tr>
            <td colspan="2">
                <br />
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:TextBox ID="tbtid" runat="server" Visible="False"></asp:TextBox>
                <asp:Image ID="Image2" runat="server" Visible="False" />
            </td>
        </tr>
        <tr>
            <td>
                Teacher Name</td>
            <td>
                <asp:TextBox ID="tbtname" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="tbtname" ErrorMessage="Plz enter full name"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Date of Birth</td>
            <td>
                <asp:DropDownList ID="dddate" runat="server">
                </asp:DropDownList>
                <asp:DropDownList ID="ddmonth" runat="server">
                    <asp:ListItem Value="1">Jan</asp:ListItem>
                    <asp:ListItem Value="2">Feb</asp:ListItem>
                    <asp:ListItem Value="3">Mar</asp:ListItem>
                    <asp:ListItem Value="4">Apr</asp:ListItem>
                    <asp:ListItem Value="5">May</asp:ListItem>
                    <asp:ListItem Value="6">Jun</asp:ListItem>
                    <asp:ListItem Value="7">Jul</asp:ListItem>
                    <asp:ListItem Value="8">Aug</asp:ListItem>
                    <asp:ListItem Value="9">Sep</asp:ListItem>
                    <asp:ListItem Value="10">Oct</asp:ListItem>
                    <asp:ListItem Value="11">Nov</asp:ListItem>
                    <asp:ListItem Value="12">Dec</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddyear" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Date of Join</td>
            <td>
                <asp:DropDownList ID="ddjdate" runat="server">
                </asp:DropDownList>
                <asp:DropDownList ID="ddjmonth" runat="server">
                    <asp:ListItem Value="1">Jan</asp:ListItem>
                    <asp:ListItem Value="2">Feb</asp:ListItem>
                    <asp:ListItem Value="3">Mar</asp:ListItem>
                    <asp:ListItem Value="4">Apr</asp:ListItem>
                    <asp:ListItem Value="5">May</asp:ListItem>
                    <asp:ListItem Value="6">Jun</asp:ListItem>
                    <asp:ListItem Value="7">Jul</asp:ListItem>
                    <asp:ListItem Value="8">Aug</asp:ListItem>
                    <asp:ListItem Value="9">Sep</asp:ListItem>
                    <asp:ListItem Value="10">Oct</asp:ListItem>
                    <asp:ListItem Value="11">Nov</asp:ListItem>
                    <asp:ListItem Value="12">Dec</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddjyear" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Gender</td>
            <td>
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                    RepeatDirection="Horizontal" Width="213px">
                    <asp:ListItem Value="f">Female</asp:ListItem>
                    <asp:ListItem Value="m">Male</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td>
                Photo</td>
            <td>
                <asp:FileUpload ID="FileUpload1" runat="server" />
                <asp:TextBox ID="tbphoto" runat="server" Visible="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Permanent Address</td>
            <td>
                <asp:TextBox ID="tbaddress" runat="server" TextMode="MultiLine"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="tbaddress" ErrorMessage="Enter full address"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Phone No.(Resi.)</td>
            <td>
                <asp:TextBox ID="tbreno" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="tbreno" ErrorMessage="Not valid,no start with 0" 
                    ValidationExpression="(0\d{9})"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Mobile No.</td>
            <td>
                <asp:TextBox ID="tbmobile" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="tbmobile" ErrorMessage="Not valid,must be 10 digit" 
                    ValidationExpression="(\d{10})"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style4">
                User Type</td>
            <td class="style4">
                <asp:DropDownList ID="ddusertype" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style4">
                Email id</td>
            <td class="style4">
                <asp:TextBox ID="tbmail" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">
                <asp:Label ID="Label1" runat="server" Text="Username"></asp:Label>
            </td>
            <td class="style4">
                <asp:TextBox ID="tbusername" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="tbpassword" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:TextBox ID="tbques" runat="server" Visible="False"></asp:TextBox>
                <asp:TextBox ID="tbanswer" runat="server" Visible="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btninsert" runat="server" onclick="btninsert_Click" 
                    Text="Insert" />
            </td>
            <td>
                <asp:Button ID="btnupdate" runat="server" onclick="btnupdate_Click" 
                    Text="Update" />
            </td>
        </tr>
        <tr>
            <td class="style5">
                </td>
            <td class="style5">
                </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    onrowdeleting="GridView1_RowDeleting" 
    onrowediting="GridView1_RowEditing" onpageindexchanging="GridView1_PageIndexChanging" 
                        AllowPaging="True">
                        <Columns>
                            <asp:BoundField DataField="teacher_name" HeaderText="TeacherName" />
                            <asp:TemplateField HeaderText="Date of Birth">
                                <ItemTemplate>
                                    <%#Eval("date_of_birth","{0:d}") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Date of Join">
                                <ItemTemplate>
                                    <%#Eval("date_of_join","{0:d}") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Photo">
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" Height="52px" 
                                    ImageUrl='<%# "~/admin/teacher/"+Eval("photo") %>' Width="88px" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="permanent_address" HeaderText="Address" />
                            <asp:BoundField DataField="mobile_pno" HeaderText="Mobile No" />
                            <asp:BoundField DataField="teacher_emailid" HeaderText="Emailid" />
                            <asp:TemplateField HeaderText="Edit">
                                <ItemTemplate>
                                    <asp:Button ID="btnedit" runat="server" 
                                    CommandArgument='<%# Eval("teacher_id") %>' CommandName="Edit" 
                                    oncommand="btnedit_Command" Text="Edit" CausesValidation="False" 
                                        Height="26px" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <ItemTemplate>
                                    <asp:Button ID="btndelete" runat="server" 
                                    CommandArgument='<%# Eval("teacher_id") %>' CommandName="Delete" 
                                    oncommand="btndelete_Command" Text="Delete" CausesValidation="False" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
